using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_itemCostsMap : EntityTypeConfiguration<so_itemCosts>
    {
        public so_itemCostsMap()
        {
            // Primary Key
            this.HasKey(t => t.Average_Cost_Base_2);

            // Properties
            this.Property(t => t.ITEM)
                .HasMaxLength(10);

            this.Property(t => t.Type)
                .HasMaxLength(50);

            this.Property(t => t.Category)
                .HasMaxLength(50);

            this.Property(t => t.Default_Vendor)
                .HasMaxLength(35);

            this.Property(t => t.Purchase_Cur)
                .HasMaxLength(5);

            this.Property(t => t.Sales_Cur)
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("so_itemCosts");
            this.Property(t => t.ITEM).HasColumnName("ITEM");
            this.Property(t => t.Average_Cost_Base_2).HasColumnName("Average_Cost_Base_2");
            this.Property(t => t.UNIT_COST_Base_2).HasColumnName("UNIT_COST_Base_2");
            this.Property(t => t.Average_Cost_Base_1).HasColumnName("Average_Cost_Base_1");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Category).HasColumnName("Category");
            this.Property(t => t.Default_Vendor).HasColumnName("Default_Vendor");
            this.Property(t => t.Purchase_Cur).HasColumnName("Purchase_Cur");
            this.Property(t => t.FOB).HasColumnName("FOB");
            this.Property(t => t.Cost_1).HasColumnName("Cost_1");
            this.Property(t => t.Cost_2).HasColumnName("Cost_2");
            this.Property(t => t.FOB_Base_1).HasColumnName("FOB_Base_1");
            this.Property(t => t.Cost_1_base_1).HasColumnName("Cost_1_base_1");
            this.Property(t => t.Cost_2_base_1).HasColumnName("Cost_2_base_1");
            this.Property(t => t.FOB_Base_2).HasColumnName("FOB_Base_2");
            this.Property(t => t.Cost_1_base_2).HasColumnName("Cost_1_base_2");
            this.Property(t => t.Cost_2_base_2).HasColumnName("Cost_2_base_2");
            this.Property(t => t.Sales_Cur).HasColumnName("Sales_Cur");
            this.Property(t => t.Retail_price).HasColumnName("Retail_price");
            this.Property(t => t.Whole_sale_price).HasColumnName("Whole_sale_price");
        }
    }
}
